<script language="javascript">
$(function(){
	$('form').form({ 
		success:function(data){
			var data = runJson(data);
			if(data.status == 0){
				alertText(data.info, 'error');
			}else{
				alertText(data.info, 'success', '{:U('Sets/index')}');
			}
		}   
	}); 
});
</script>
<div class="wrapper clear">
	<div class="main">
		<if condition="!empty($button)">
        <div class="toolbar">
			<volist name="button" id="btn">
			<a href="{$btn.href}" class="btn" id="">{$btn.text}</a>
			</volist>
		</div>
		</if>
		<div class="search">
            <div class="searchbox">
<form action="<eq name='ACTION_NAME' value='edit'>{:U('Sets/update')}<else />{:U('Sets/insert')}</eq>&ajax=true" method="post">
  <table class="tableform" cellpadding="0" cellspacing="0" style="width:900px;">
    <tr>
      <th>变量名：</th>
      <td><input type="text" value="{$vo.var}" id="var" name="var" style="width:200px;" class="easyui-validatebox input text" required="true" validType="length[3,20]" /></td>
    </tr>
    <tr>
      <th>显示名：</th>
      <td><input type="text" value="{$vo.name}" id="name" name="name" style="width:200px;" class="easyui-validatebox input text" required="true" validType="length[2,20]" /></td>
    </tr>
    <tr>
      <th>所属上级分类：</th>
      <td><select name="parent_id" required="true" validType="length[1,20]">
          <option value="0">顶级分类</option>
          <volist name="catelist" id="cate"> <option value="{$cate.id}" 
            <if condition="$vo['parent_id'] eq $cate['id']">selected</if>
            >{$cate.repeat}{$cate.name}
            </option>
          </volist>
        </select></td>
    </tr>
    <tr>
      <th>默认值：</th>
      <td><input type="text" value="{$vo.value}" id="value" name="value" style="width:200px;" class="easyui-validatebox input text" required="true" validType="length[1,15]" /></td>
    </tr>
    <tr>
      <th>可选值列表：</th>
      <td><input type="text" value="{$vo.value_list}" id="value_list" name="value_list" style="width:300px;" class="input text" />
        <p class="notice">多个可选值用","隔开，显示名称与值之间用"|"隔开。</p></td>
    </tr>
    <tr>
      <th>排序：</th>
      <td><input type="text" value="{$vo.sort}" id="sort" name="sort" style="width:100px;" class="input text" /></td>
    </tr>
    <tr>
      <th>所属组：</th>
      <td><select name="parent_id">
          <volist name="group" id="gp">
            <option value="{$key}">{$gp}</option>
          </volist>
        </select></td>
    </tr>
    <tr>
      <th>类型：</th>
      <td><select name="type">
          <volist name="type" id="tp">
            <option value="{$key}">{$tp}</option>
          </volist>
        </select></td>
    </tr>
    <tr>
      <th>备注：</th>
      <td><textarea name="desc" style="width:350px; height:100px;" class="input textarea"></textarea></td>
    </tr>
    <tr>
      <th>&nbsp;</th>
      <td><eq name='ACTION_NAME' value='edit'>
          <input type="hidden" name="id" value="{$vo.id}" />
        </eq></td>
    </tr>
  </table>
  <!--添加-->
  <table align="center">
    <tr>
      <td align="center"><input class="submit" type="submit" value="保存" id="submits" onclick="return $('form').form('validate')" />
        <input class="cancel" type="reset" value="取消" /></td>
    </tr>
  </table>
  <!--end添加--> 
</form>

			</div>
		</div>		
	</div>
</div>	